import 'package:flutter/material.dart';
import 'package:test_flutter/l10n/localization_intl.dart';
import 'package:test_flutter/l10n/localization_original.dart';

class LocalizationRoute extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("New route"),
      ),
      body: _buildContentView(context),
    );
  }

  Widget _buildContentView(BuildContext context) {
    return Column(
      children: [
        // 获取当前区域Locale的方法：
        Text('当前系统所选的语言：${Localizations.localeOf(context)}'),
        Text('自己的支持多语言的字符：${DemoLocalizations1.of(context)?.title}'),
        Text('使用了intl框架的: ${DemoLocalizations.of(context)?.myString}'),
      ],
    );
  }
}
